<? 
	session_start();
	require("connect.php");
	$magv=$_POST["magv"];
	$hotendem=$_POST["hotendem"];
	$ten=$_POST["ten"];
	$anh=$_POST["anh"];
	$gioitinh=$_POST["gioitinh"];
	$ngay=$_POST["demol1"];	
	$ngaythang=split("-",$ngay);	
	$ngaykt=$ngaythang[0];
	$thangkt=$ngaythang[1];
	$namkt=$ngaythang[2];	
	$ngaysinh=$namkt."-".$thangkt."-".$ngaykt;	
	$quequan=$_POST["quequan"];
	$email=$_POST["email"];
	$sodt=$_POST["sodt"];
	$matkhau=md5($magv);		
	$quyen='2';
	$sql="insert into giaovien(magv,hotendem,ten,anh,gioitinh,ngaysinh,quequan,email,sodt) values('{$magv}','{$hotendem}','{$ten}','{$anh}','{$gioitinh}','{$ngaysinh}','{$quequan}','{$email}','{$sodt}')";	
	$sql1="insert into nguoidung(username,password,quyen) values('{$magv}','{$matkhau}','{$quyen}')";
	mysql_query("$sql") or die("Error!");
	mysql_query("$sql1") or die("Error!");
	mysql_close();
	header("Location:giaovien_admin.php");		
?>